package com.renfei.camerapreviewdemo.presenter;

import android.graphics.SurfaceTexture;
import android.opengl.EGLContext;

import androidx.fragment.app.Fragment;


/**
 * 预览画面的presenter
 *
 * @author CainHuang
 * @date 2019/7/3
 */
public abstract class PreviewPresenter<T extends Fragment> extends IPresenter<T> {

    PreviewPresenter(T target) {
        super(target);
    }

    /**
     * 绑定SharedContext
     *
     * @param context SharedContext
     */
    public abstract void onBindSharedContext(EGLContext context);

    /**
     * SurfaceTexture 创建
     *
     * @param surfaceTexture
     */
    public abstract void onSurfaceCreated(SurfaceTexture surfaceTexture);

    /**
     * SurfaceTexture 发生变化
     *
     * @param width
     * @param height
     */
    public abstract void onSurfaceChanged(int width, int height);

    /**
     * SurfaceTexture 销毁
     */
    public abstract void onSurfaceDestroyed();


    /**
     * 拍照
     */
    public abstract void takePicture();

    /**
     * 切换相机
     */
    public abstract void switchCamera();


}
